home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-11 / ksgclock.zip / TEST.PRG < prev    next >
Text File  |  1992-08-20  |  5KB  |  109 lines

  1. /*┌────────────────────────────────────────────────────────────────────────┐
  2.   │ Program Name: TEST.PRG          Copyright: Gallagher Computing Corp.   │▐                           
  3.   │ Date Created: 08/18/92           Language: Clipper 5.0                 │▐                      
  4.   │ Time Created: ********             Author: Kevin S Gallagher  .PRG     │▐
  5.   │ c:/brief/clipper.src               Author: Ben Echols         .ASM     │▐
  6.   │                                                                        │▐
  7.   │ This clock function could be called directly, using the two function   │▐
  8.   │ calls within TICKER.OBJ or with error-checking values returned.        │▐
  9.   │ It is presented here in one of many ways to install/remove it.         │▐
  10.   │                                                                        │▐
  11.   │ If you like this function please send $5.00 (not required but helpful) │▐
  12.   │ MASM source code send $10.00                                           │▐
  13.   │ Comments GOOD/BAD are always welcomed!                                 │▐
  14.   │                                                                        │▐
  15.   │ Gallagher Computing Corp.                                              │▐
  16.   │ 660 Woodward Drive                                                     │▐
  17.   │ Huntingdon Valley PA. 19006                                            │▐
  18.   │ COMPUSERVE CIS 70034,2313                                              │▐
  19.   │                                                                        │▐
  20.   │ Enjoy!                                                                 │▐
  21.   └────────────────────────────────────────────────────────────────────────┘▐
  22.    ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  23. */
  24.  
  25. #include "include1.ch"                         
  26.  
  27. function test
  28.     local oldcur := setcursor( 0 )
  29.     local SaveFullScreen(), x
  30.     Panel( .T. )
  31.     CLOCK ROW 0 COL 71                        // Install clock
  32.     do while LASTKEY() != K_ESC
  33.        DoWait( 0 )
  34.     enddo
  35.     CLOCK x ROW 99 COL 99                     // remove it with errolevel
  36.     RestFullScreen()
  37.     setcursor( 1 )
  38.     @ 0,0 say PADR("CLOCKS RETURN CODE "+LTRIM(STR( x )),80) color "W+/B"
  39.     @ 3,0 say ""
  40. return nil
  41.  
  42. function MCLOCK(nRow,nCol)
  43.     local nErrLevel := 102
  44.     *
  45.     * You do not need to call the clock like this
  46.     * unless an errorlevel is desired
  47.     *
  48.     do case
  49.         case valtype(nRow) = "C" .OR. valtype(nCol) = "C"
  50.             return 101
  51.         case nRow = 99 .OR. nCol = 99
  52.             nErrLevel:= BK_TICKREM()
  53.         case nCol >= 0 .AND. nCol <= 71 .AND. nRow >= 0 .AND. nRow <= 24
  54.             nErrLevel := BK_TICKINS(nRow, nCol)
  55.     endcase
  56.     if nErrLevel=97 .OR. nErrLevel=1
  57.         alert("   FATAL ERROR   ",{" REBOOT NOW "},"W+/B")
  58.     endif
  59. return nErrLevel
  60.  
  61. function DoWait(wTime)
  62.    local key, cblock
  63.    do case
  64.       case pcount() == 0
  65.          key:=inkey()
  66.       case wTime == NIL .and. pcount() == 1
  67.          key:=inkey(0)
  68.       otherwise
  69.          key:=inkey(wTime)
  70.    endcase
  71.    cblock:=Setkey(key)
  72.    if cblock !=NIL   ; eval(cblock,procname(1),procline(1), NIL) ;   endif
  73. return key
  74.  
  75. function HELP
  76.     local SaveFullScreen()
  77.     local oldcolor := setcolor("N/BG")
  78.     BoxShad( 3, 3, MAXROW()-3, MAXCOL()-4, "W+/BG" )
  79.     @ 4,5 say "The clock presented here was designed to resemble the clock that is"
  80.     @ 5,5 say "used in BRIEF Programmer Editor (c) SolutionSystems. It was created"
  81.     @ 6,5 say "with Microsoft MASM 6.0,  which is an event driven clock. If you do"
  82.     @ 7,5 say "not uninstall the clock prior to exiting the  application, then the"
  83.     @ 8,5 say "computer system will surely CRASH!"
  84.     @ 9,5 say "You can parse the return errorlevel from the clock (see .prg file):"
  85.     @10,5 say "Install  BK_TICKINS( <nRow>, <nCol> ) --> nErrorLevel"
  86.     @11,5 say "Remove   BK_TICKREM()                 --> nErrorLevel"
  87.     @12,5 say "nErrorLevel codes:"
  88.     @13,5 say "  100   successful"
  89.     @14,5 say "   99   col out of range                  //  BK_TICKINS() only"
  90.     @15,5 say "   98   row out of range                  //  BK_TICKINS() only"
  91.     @16,5 say "   97   already installed/not reinstalled"
  92.     @17,5 say "<nRow>  0-24 row where clock is positioned"
  93.     @18,5 say "<nCol>  0,72 col where clock is positioned"
  94.     @19,5 say "The clock uses the current color at <nRow>, <nCol>"
  95.     @20,5 say "Notice the top bar color has change, as did the clock color!"
  96.     @00,0 say PADR(" ",80) color "GR+/RB"
  97.     @24,0 say PADR(" Press ESC to exit or any key to exit HELP",80) color "GR+/RB"
  98.     inkey( 0 )
  99.     setcolor( oldcolor )
  100.     RestFullScreen()
  101. return nil
  102.  
  103. init function haha
  104.     *******************************************
  105.     *▒▒ prevent pre-mature exiting of demo ▒▒▒*
  106.     *******************************************
  107.     setcancel( .F. )
  108. return nil
  109.